package com.ning.activitys.skysound.fragment;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ning.activitys.skysound.R;
import com.ning.activitys.skysound.adpter.MusicPavilionAdapter;
import com.ning.activitys.skysound.base.BaseFragment;

/**
 * Created by dllo on 16/1/8.
 */
public class MusicPavilionFragment extends BaseFragment{

    private TabLayout tabLayout;
    private ViewPager viewPager;
    private MusicPavilionAdapter adapter;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        Log.e("onCreateView", "MusicPavilionFragment----onCreateView");

        View view = inflater.inflate(R.layout.fragment_music_pavilion,null);
        return view;

    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        tabLayout = (TabLayout) view.findViewById(R.id.tab_layout_music_pavilion);
        viewPager = (ViewPager) view.findViewById(R.id.view_pager_music_pavilion);

        adapter = new MusicPavilionAdapter(getActivity().getSupportFragmentManager());
        viewPager.setAdapter(adapter);
        tabLayout.setupWithViewPager(viewPager);
        tabLayout.setTabTextColors(Color.BLACK, Color.GREEN);
        tabLayout.setSelectedTabIndicatorColor(Color.GREEN);
        //tabLayout.setSelectedTabIndicatorHeight(20);
    }
}
